import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
//class ColorItem
    
    export  class ColorItem /* flash.display.Sprite */
    {
        constructor(arg1: uint)
        {
            
            this.drawAndFill(arg1);
            this.color = arg1;
            this.addEventListener(flash.events.MouseEvent.CLICK, this.onColorItemClickHandler);
            return;
        }

        /* internal  */drawAndFill(arg1: uint): void
        {
            this.graphics.beginFill(arg1);
            this.graphics.moveTo(0, 0);
            this.graphics.lineTo(30, 0);
            this.graphics.lineTo(30, 20);
            this.graphics.lineTo(0, 20);
            this.graphics.endFill();
            return;
        }

        /* internal  */onColorItemClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            dispatchEvent(new DataEvent(EventName.ChatColorSelect, this.color));
            return;
        }

        /* internal */ /* var */color: uint;
    }
